package com.ruoyi.system.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Objects;

/**
 * 模型管理对象 r_model
 * 
 * @author ruoyi
 * @date 2022-09-25
 */
public class RModel extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 模型名称 */
    @Excel(name = "模型名称")
    private String projName;

    /** 模型位置 */
    @Excel(name = "模型位置")
    private String path;

    /** conda库位置 */
    @Excel(name = "conda库位置")
    private String condaPath;

    /**
     * 默认  conda库路径
     */
    private String defaultCondaPath;

    /** 预览URL */
    @Excel(name = "预览URL")
    private String url;



    /** 启动文件名 */
    @Excel(name = "启动文件名")
    private String startName;

    /** 模型文件名 */
    @Excel(name = "模型文件名")
    private String modelName;

    /** 环境文件名 */
    @Excel(name = "环境文件名")
    private String condaName;


    /** 模型运行状态(0 停止 1 启动中 2 运行中) */
    @Excel(name = "模型运行状态(0 停止 1 启动中 2 运行中)")
    private Integer runStatus;

    /** 模型状态(0 压缩包 1 解压中 2 已解压) */
    @Excel(name = "模型状态(0 压缩包 1 解压中 2 已解压)")
    private Integer modelStatus;

    private String code;

    public String getDefaultCondaPath() {
        return defaultCondaPath;
    }

    public void setDefaultCondaPath(String defaultCondaPath) {
        this.defaultCondaPath = defaultCondaPath;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setProjName(String projName) 
    {
        this.projName = projName;
    }

    public String getProjName() 
    {
        return projName;
    }
    public void setPath(String path) 
    {
        this.path = path;
    }

    public String getPath() 
    {
        return path;
    }
    public void setCondaPath(String condaPath) 
    {
        this.condaPath = condaPath;
    }

    public String getCondaPath() 
    {
        return condaPath;
    }
    public void setUrl(String url) 
    {
        this.url = url;
    }

    public String getUrl() 
    {
//        if(Objects.nonNull(this.runStatus)&&this.runStatus==0){
//            return "../img/profile1.png";
//        }
        return url;
    }
    public void setStartName(String startName) 
    {
        this.startName = startName;
    }

    public String getStartName() 
    {
        return startName;
    }
    public void setModelName(String modelName) 
    {
        this.modelName = modelName;
    }

    public String getModelName() 
    {
        return modelName;
    }
    public void setCondaName(String condaName) 
    {
        this.condaName = condaName;
    }

    public String getCondaName() 
    {
        return condaName;
    }
    public void setRunStatus(Integer runStatus) 
    {
        this.runStatus = runStatus;
    }

    public Integer getRunStatus() 
    {
        return runStatus;
    }
    public void setModelStatus(Integer modelStatus) 
    {
        this.modelStatus = modelStatus;
    }

    public Integer getModelStatus() 
    {
        return modelStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("projName", getProjName())
            .append("path", getPath())
            .append("condaPath", getCondaPath())
            .append("url", getUrl())
            .append("startName", getStartName())
            .append("modelName", getModelName())
            .append("condaName", getCondaName())
            .append("runStatus", getRunStatus())
            .append("modelStatus", getModelStatus())
            .toString();
    }
}
